﻿@using YanForum.Engine.ViewModels
@model List<CommentItem>

@{
    var isAdmin = Request.IsAuthenticated && User.IsInRole(YanForum.Engine.ViewModels.UserRoles.Admin);
}

<i class="arrow-top"></i>
<ul class="list-unstyled">
    <!-- LIST SUB COMMENT -->
    @foreach (var item in Model)
    {
        <li class="sub-comment-item">
            @if (isAdmin)
                {
                    <i class="deleteComment glyphicon glyphicon-remove pointer text-red" title="Xóa comment này" data-id="@item.Id"></i>
                }
            <div class="row">
                <div class="col-md-12 comment-content media">
                    <div class="c-content media-body">
                        @Html.Raw(item.CommentPost)
                    </div>
                </div>
                <div class="col-md-12 user-info">
                    <div class="row">
                        <div class="col-md-12">
                            <img class="pull-left img-avatar" src="@item.UserAvatar" alt="@item.FullName" />
                            <div class="pull-left">
                                <div><strong>@item.FullName</strong> - <span class="time text-muted">@item.TimeAgo</span></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </li>
    }
    <!-- END LIST SUB COMMENT -->
</ul>
